from collections import defaultdict

def wordcount(test):
  wordlist = test.split()
  words = defaultdict(int)

  for word in wordlist:
    words[word] += 1

  for word in words:
    print "%s appears %d times" % (word, words[word])
